<template>
	<view class="travelApply-bill">
		<view class="top">
			<text class="title">单据模版</text>
			<view class="template-box">
				<view class="left">
					<icon-svg icon-class="shenqing" style="color: #FFA07A"/>
					<text style="color:#595959;">还款单</text>
				</view>
				<view class="right">
					<navigator url="./billsTemplate">
						<text style="color:#FFA07A;font-size: 30rpx;">切换模版</text>
					</navigator>
				</view>
			</view>
		</view>
		<view class="center">
			<form  class="handFormBox" @submit="formSubmit" @reset="formReset">
				<view class="uni-form-item" v-for="(item, index) in formList" :key="index">
					<view>
						<view class="title">{{item.title}}:</view>
						<view>
							<input class="uni-input" v-model="item.value" 
								:name="item.name" :placeholder="item.placeholder" 
							/>
						</view>
					</view>
				</view>
			</form>
		</view>
		<view class="addRepay">
			<text class="title">核销借款：</text>
			<navigator url="./addRepayBill">
				<view class="addBilltitle">添加核销借款</view>
			</navigator>
		</view>
		<view class="footer">
			<button >存为草稿</button>
			<button style="background:#FFA07A;color:#fff;" @click="handleSubmit">提交送审</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				formList:[
					{'title': '报销人','placeholder': '请输入名称','name': 'input','value': '陈赫斯'},
					{'title': '还款单位','placeholder': '请选择费用承担单位','name': 'input','value': '时代邻里股份有限公司'},
					{'title': '还款部门','placeholder': '','name': 'input','value': '公共部门'},
					{'title': '还款金额','placeholder': '请输入借款金额','name': 'input','value': ''},
					{'title': '收支项目','placeholder': '请输入标题','name': 'input','value': ''},
					{'title': '预算承担单位','placeholder': '请输入名称','name': 'input','value': '时代邻里股份有限公司'},
					{'title': '预算承担部门','placeholder': '请输入名称','name': 'input','value': '公共部门'},
					{'title': '附件','placeholder': '（选填）','name': 'input','value': ''},
				]
			};
		},
		methods: {
			handleSubmit() {
				uni.showModal({
					showCancel: false,
					confirmText: '知道了',
					confirmColor: '#32b6c5',
					content: '提交成功，请耐心等待审批',
					success() {
						uni.reLaunch({
							url: '/pages/index/index'
						})
					}
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	@import "@/pages/add/add.scss";
	.addRepay{
		background-color: #fff;
		padding-top: 12px;
		.title{padding-left: 12px;}
		.addBilltitle{
			font-size: 18px;
			font-weight: bold;
			@include divH(90rpx);
			width: 100%;
			text-align: center;
			color: $themeColor;
		}
	}
.travelApply-bill{
	position:relative;
	padding-bottom: 140rpx;
	.top{
		background-color: #fff;
		.title{
			margin: 20rpx 0 0 20rpx;
			color: #ccc;
			display: inline-block;
		}
		.template-box{
			padding: 10rpx 20rpx;
			display: flex;
			justify-content: space-between;
			line-height: 60rpx;
			height: 60rpx;
			.left{
				.svg-icon{
					color:#1E88E8;
					font-size: 1.4em;
				}
				text{
					margin-left: 14rpx;
				}
			}
		}
	}
	.center{
		background-color: #fff;
		margin-top: 20rpx;
		.handFormBox{
		 .uni-form-item{
			 padding:12rpx 20rpx;
			 color: #595959;
			 font-size: 34rpx;
			 border-bottom: 1px solid #EEEEEE;
			 .title{
				 padding: 10rpx 0;
			 }
			.title::before{
				content: '*';
				color:red;
			} 
			.uni-input-placeholder{
				color: #ccc;
				margin-left: 10rpx;
			}
		 }
		}
	}
	.op{
		background-color: #fff;
		margin-top: 20rpx;
		.remark{
		 line-height: 100rpx;
		 height: 100rpx;	
		}
		.op-box{
		  line-height: 100rpx;
		  height: 100rpx;
		  border-top: 1px solid #ccc;
		  span{
				width: 49%;
				text-align: center;
				display: inline-block;
				color:#33B6C6;
			}
		}
	}
	.footer{
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		display: flex;
		background-color: #fff;
		padding: 20rpx ;
		button{
			width: 100%;
		}
	}
}
</style>
